

import java.util.Hashtable;
import java.util.Vector;


/**
 * This abstract class have to represent all the possible input (bluetoot, wifi, user...)
 * In order to recognize the input, a type is given.
 * This type is represented by a int and could be:
 *  1 for BLUETOOTH
 * 	2 for USER
 *  3 for HTTP
 * @author Mathieu Maret
 */


public abstract class EasyAwarenessInput {

	static int BLUETOOTH = 1;
	static int USER = 2;
	static int HTTP = 3;
	EasyAwarenessManager manager = null;
	String name; 
	int type;
	
	Hashtable ConnectionDialerForService;
	
	/**
	 * This method is called when the addInput() is called in the EasyAwarnessManager
	 * @param Inputmanager
	 */
	public void setManager(EasyAwarenessManager Inputmanager){
		manager = Inputmanager;
	}
	
	
	/**
	 * @return the manager attached to this input
	 */
	public EasyAwarenessManager getManager(){
		return manager;
	}
	
	/**
	 * launch the research on this device
	 * 
	 */
	public abstract void Research();



	/**
	 * Add a dialer associated to a service 
	 * @param service
	 * @param dialer
	 */
	public void addDialer(Object service, ConnectionDialer dialer){
		ConnectionDialerForService.put(service,dialer);
	}
	
	public void remDialer(Object service){
		ConnectionDialerForService.remove(service);
	}
	
	public void removeAllDialer(){
		ConnectionDialerForService.clear();
	}
	/**
	 * @return the commun name of an input
	 */
	public String getName() {
		return name;
	}

	/**
	 * Give to a input a commun name
	 * @param name the commun name of the input
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	
	/**
	 * return the type of the input
	 * @return could be EasyAwarness.BLUETOOTH for bluetooth or EasyAwarness.USER
	 */
	public int getType() {
		return type;
	}
	
	/**
	 * Set the type of a input 
	 * @param type could be EasyAwarness.BLUETOOTH for bluetooth or EasyAwarness.USER
	 */
	public void setType(int type) {
		this.type = type;
	}
}
